import request from '../common/fetch'
//登陆
function login(data){
    return request({
        url:'api/user/login',
        method:'post',
        data
    })
}
//注册
function register(data){
    return request({
        url:'api/user/register',
        method:'post',
        data
    })
}
//检测用户名是否可用
function checkUserName(data){
    return request({
        url:'api/user/checkUserName',
        method:'post',
        data
    })
}
function getList(data){
    return request({
        url:'api/messageboard/list',
        method:'get',
        data
    })
}
//获取我的list
function getMyList(data){
    return request({
        url:'api/messageboard/myList',
        method:'get',
        data
    })
}
//获取我的垃圾箱的list
function getGarbageList(data){
    return request({
        url:'api/messageboard/garbageList',
        method:'get',
        data
    })
}
function updateMessageboard(data){
    return request({
        url:'api/messageboard/update',
        method:'post',
        data
    })
}
function addMessageboard(data){
    return request({
        url:'api/messageboard/new',
        method:'post',
        data
    })
}
function delMessageboard(data){
    return request({
        url:'api/messageboard/del',
        method:'post',
        data
    })
}
//确认删除
function deleteMessageboard(data){
    return request({
        url:'api/messageboard/delete',
        method:'post',
        data
    })
}
//恢复
function recovery(data){
    return request({
        url:'api/messageboard/recovery',
        method:'post',
        data
    })
}


export default{
    login,
    checkUserName,
    getList,
    getMyList,
    getGarbageList,
    register,
    addMessageboard,
    updateMessageboard,
    delMessageboard,
    deleteMessageboard,
    recovery
}